package org.september.pisces.sms.service;

import org.september.core.component.ApplicationContextHolder;
import org.september.pisces.settings.service.PiscesSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SmsServiceManger {

	@Autowired
	private PiscesSettingService piscesSettingService;
	

	public GeneralSmsService getSmsService() {
		String name = piscesSettingService.getValueOrDefault("短信推送模块","sms_plat_name","fei_ge_sms","启用短信平台名称称","");
		GeneralSmsService smsService=null;
		if("fei_ge_sms".equals(name)) {
			smsService = ApplicationContextHolder.getContext().getBean(FeiGeSmsService.class);
		}else if("mobile_mas_sms".equals(name)) {
			MobileMasService mms = ApplicationContextHolder.getContext().getBean(MobileMasService.class);
			mms.init();
			smsService = mms;
		}
		return smsService;
	}
	
}
